# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=ion-shell
pkgver=1.0.5_git20230420
pkgrel=0
_commit=60bfb73351f0412c95b8ba2afe75e988514470a6
pkgdesc="modern system shell with simple, yet powerful, syntax"
url="https://doc.redox-os.org/ion-manual/"
arch="all !s390x !riscv64" # s390x blocked by nix crate
license="MIT"
makedepends="cargo cargo-auditable"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
source="$pkgname-$_commit.tar.gz::https://gitlab.redox-os.org/redox-os/ion/-/archive/$_commit.tar.gz
	0001-bump_getrandom_crate.patch
	0002-remove_errno-dragonfly.patch
	0003-remove_redox_users.patch
	"
builddir="$srcdir/ion-$_commit"


prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --release --frozen
}

package() {
	install -Dm0755 target/release/ion -t "$pkgdir"/usr/bin
}

sha512sums="
2140209c4559301ea3c00924de540cc56843ca2e29500794147ff2fe0c3a838a24a89424c0b88d1a305fc97b61a0442da45d8ee19cfb41ce33ddfab11514610c  ion-shell-60bfb73351f0412c95b8ba2afe75e988514470a6.tar.gz
c318444c1a6a701a7e0853ef78ec4987f787a090a0eeb11ba36d674ebe0d384df49069437cd250921c19f1a3c28327581faea04e9af8fb818aae90db37536a84  0001-bump_getrandom_crate.patch
1d82579be900b97a23b3fc39789d8d191f34dc698cd412f72e38b8ee20ad50ce5560cdcc4a6fd6766a3407bd8325f9dbb33aec38d10eebfa7f4b87746e7f161c  0002-remove_errno-dragonfly.patch
e8a4ba03ac7988d41469031229cb294593a05f412f18db843451fe73672461454b8cb42d5440998c937295efab9bd49f4076ccb4294ec1ef0ed1ece1926bc812  0003-remove_redox_users.patch
"
